package com.tiger.project.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tiger.common.annotation.Excel;
import com.tiger.common.core.domain.BaseEntity;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;


/**
 * 【合同账单】对象 contract_bill
 *
 * @author standard
 * @date 2022-09-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "contract_bill对象", description = "【合同账单】内容")
public class ContractBill extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long id;



    @ApiModelProperty(value = "公司id")
    private Long deptId;

    @ApiModelProperty(value = "合同名称")
    private String name;

    /**
     * 合同发起id
     */
    @Excel(name = "合同发起id")
    @ApiModelProperty(value = "合同发起id")
    private Long contractSponsorId;

    /**
     * 租赁开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "租赁开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "租赁开始日期")
    private Date rentStateTime;

    /**
     * 租赁结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "租赁结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "租赁结束日期")
    private Date rentEndTime;

    /**
     * 应缴开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "应缴开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "应缴开始日期")
    private Date payableStateTime;

    /**
     * 应缴结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "应缴结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "应缴结束日期")
    private Date payableEndTime;

    /**
     * 租赁金额
     */
    @Excel(name = "租赁金额")
    @ApiModelProperty(value = "租赁金额 本期应付")
    private BigDecimal rentMoney;

    /**
     * 租赁期数
     */
    @Excel(name = "租赁期数")
    @ApiModelProperty(value = "租赁期数")
    private Long rentPeriods;

    /**
     * 决策依据id
     */
    @Excel(name = "决策依据id")
    @ApiModelProperty(value = "决策依据id  逗号拼接")
    private String decisionId;

    /**
     * 减免金额
     */
    @ApiModelProperty(value = "减免金额")
    private BigDecimal creditAmount;

    /**
     * 减免原因
     */
    @ApiModelProperty(value = "减免原因")
    private String creditRemark;


    @ApiModelProperty(value = "合同编码")
    private String contractSponsorNo;

    @ApiModelProperty(value = "资产名称")
    private String assetName;

    @ApiModelProperty(value = "承租单位")
    private String lesseeName;

    @ApiModelProperty(value = "剩余天数")
    private Integer residueDay;

    @ApiModelProperty(value = "预警")
    private Integer warning;


    /**
     * 合同类别  1-房屋租赁合同，2-土地租赁合同
     */
    @Excel(name = "合同类别  1-房屋租赁合同，2-土地租赁合同")
    @ApiModelProperty(value = "合同类别  1-房屋租赁合同，2-土地租赁合同")
    private String contractType;

    /**
     * 发票类型 1-普通发票 2-专用发票 3-收据
     */
    @Excel(name = "发票类型 1-普通发票 2-专用发票 3-收据")
    @ApiModelProperty(value = "发票类型 1-普通发票 2-专用发票 3-收据")
    private String isDedicated;

    /**
     * 开票期限
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开票期限", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "开票期限")
    private Date invoiceTime;

    /**
     * 开票金额
     */
    @Excel(name = "开票金额")
    @ApiModelProperty(value = "开票金额")
    private BigDecimal invoiceAmount;

    @ApiModelProperty(value = "开票单位")
    private String lessorName;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "决策依据集合")
    private List<CommonDecision> decisionList = new ArrayList<>();

    @ApiModelProperty(value = "减免信息")
    private List<ContractSponsorCredit> creditList = new ArrayList<>();

    /**
     * OA审核状态 1-未提交，2-审批中，3-审批通过，4-已驳回
     */
    @Excel(name = "OA审核状态 开票信息 1-未提交，2-审批中，3-审批通过，4-已驳回")
    @ApiModelProperty(value = "OA审核状态 开票信息 1-未提交，2-审批中，3-审批通过，4-已驳回")
    private Long status;

    /**
     * 租金进账审核  0-待进账 1-未提交，2-审批中，3-审批通过，4-已驳回
     */
    @ApiModelProperty(value = "租金进账审核  0-待进账 1-未提交，2-审批中，3-审批通过，4-已驳回")
    private Long arrivalStatus;

    /**
     * 租金到账审核状态 0-待到账 1-未提交，2-审批中，3-审批通过，4-已驳回
     */
    @ApiModelProperty(value = "租金到账审核状态 0-待到账 1-未提交，2-审批中，3-审批通过，4-已驳回")
    private Long recordStatus;


    @ApiModelProperty(value = "oa审批链接")
    private String OaFile;

    @ApiModelProperty(value = "财务部-负责人是否开票")
    private String isMakeInvoice;

    @ApiModelProperty(value = "发起人是否拿票")
    private String isGetInvoice;

    @ApiModelProperty(value = "开始时间 查询")
    private String startTime;

    @ApiModelProperty(value = "结束时间 查询")
    private String endTime;

    @ApiModelProperty(value = "申请人id")
    private Long applyId;

    @ApiModelProperty(value = "申请人名称")
    private String applyName;

    @ApiModelProperty(value = "租金到账 删除标志 0-未删除 1-已删除")
    private Integer recordDel;

    @ApiModelProperty(value = "租金进账  删除标志 0-未删除 1-已删除")
    private Integer arrivalDel;

    @ApiModelProperty(value = "列表类型 1-租金进账 2-租金到账")
    private Integer type;

    @ApiModelProperty(value = "OA审批链接 租金到账")
    private String oaFileRecord;

    @ApiModelProperty(value = "OA审批链接 租金进账")
    private String oaFileArrival;

    @ApiModelProperty(value = "账单状态 1-待付款 2-未缴清 3-已缴清")
    private Integer billStatus;

    @ApiModelProperty(value = "租金收款缴费/到账 集合")
    private List<PayInfo> payInfoList = new ArrayList<>();

    @ApiModelProperty(value = "租金分配每期收款集合")
    private List<AssetReceiptAllocation> allocationList = new ArrayList<>();


    @ApiModelProperty(value = "本期缴款")
    private BigDecimal receiptMoney;

    @ApiModelProperty(value = "本期到账")
    private BigDecimal totalAccount;

    @ApiModelProperty(value = "本期实收")
    private BigDecimal officialReceipts;

    @ApiModelProperty(value = "累计应收")
    private BigDecimal countMoneys;

    @ApiModelProperty(value = "累计已收")
    private BigDecimal countPay;

    @ApiModelProperty(value = "租金进账 缴款时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date payTime;

    @ApiModelProperty(value = "租金进账  缴款凭证号")
    private String payNumber;

    @ApiModelProperty(value = "租金到账 收款时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date arrivalTime;

    @ApiModelProperty(value = "租金到账 收款凭证号")
    private String arrivalNumber;

    @ApiModelProperty(value = "1-进账 2-到账")
    private Integer payType;



    //当期期之前的租赁金额总和
    private BigDecimal countMoney;

    @ApiModelProperty(value = "最大期数")
    private Long maxPeriods;


    @ApiModelProperty(value = "1-升序 2-倒叙")
    private Long rank;


    @ApiModelProperty(value = "OA的token")
    private String token;

    @ApiModelProperty(value = "OA的登录人")
    private String loginName;

}
